*THis replicates Table 1 in Wig et al. 2025


*Loading the data
clear
use "data_directed3.dta"

*panel structure
xtset dyadid year
label variable v2regsupgroupssize_min "Support group size (dyad)"
label variable cap_1 "CINC$_{i}$"
label variable cap_2 "CINC$_{j}$"
label variable contig "Contiguity"
label variable ldistance "L(distance)"
label variable c1_s_far_maddisonGDP "GDP$_{i}$"
label variable c2_s_far_maddisonGDP "GDP$_{j}$"
label variable c1_s_far_Maddison_pop_estimate "Pop$_{i}$"
label variable c2_s_far_Maddison_pop_estimate "Pop$_{j}$"
label variable v2x_polyarchy_min "Polyarchy (dyad)"
label variable polity_min "Democracy (polity) (dyad)"
label variable cwpceyrs "Peace years"
label variable cwpceyrs2 "Peace years$^{2}$"
label variable cwpceyrs3 "Peace years$^{3}$"
label variable v2regsupgroupssize_min "Support group size (dyad)"
label variable c1_business "Business elites $_{i}"
label variable c2_business "Business elites $_{j}"
label variable c1_business_a "Business elites $_{i}"
label variable c2_business_a "Business elites $_{j}"
label variable business_business_a "Business elites (dyad)"
label variable c1_business_r "Business elites share s$_{i}"
label variable c1_business_r "Business elites share s$_{i}"
label variable c2_business_r "Business elites share $_{j}"
label variable c1_urbmidclass "Urban middle class $_{i}"
label variable c1_urbmid_r "Urban middle class share $_{i}"
label variable c1_urbworkers "Industrial workers $_{i}"
label variable c1_urbworkers_r "Industrial workers share $_{i}"
label variable c1_military "Military $_{i}"
label variable c1_military_r "Military share $_{i}"
label variable c1_party "Party elites $_{i}"
label variable c1_party_r "Party elites share $_{i}"
label variable c2_party "Party elites $_{j}"
label variable c2_party_r "Party elites share$_{j}"
label variable party_party "Party elites dyad"
label variable party_party_ "Party elites share dyad"
label variable c1_urbmidclass_r "Urban middle class share $_{i}"
label variable c1_business_r "Business elites share s$_{i}"
label variable c2_business_r "Business elites share $_{j}"
label variable business_business "Business elites (dyad)"
label variable business_business_r "Business elites share (dyad)"
label variable cwpceyrs "Peace years"
label variable cwpceyrs "Peace years"
label variable cwpceyrs2 "Peace years$^{2}$"
label variable cwpceyrs3 "Peace years$^{3}$"
label variable v2regsupgroupssize_min "Support group size (dyad)"

label variable c1_business_one "Business elites $_{i}"
label variable c1_business_a "Business elites $_{i}"
label variable c1_business_imp "Business elites $_{i}"
label variable c2_business_one "Business elites $_{i}"
label variable c2_business_a "Business elites $_{j}"
label variable c2_business_imp "Business elites $_{i}"
label variable business_business_a "Business elites (dyad)"
label variable business_business_imp "Business elites (dyad)"
label variable business_business_one "Business elites (dyad)"

 
*****************************************

***TABLE 1: 

*****************************************
set more off

****MODELS WITH THE "PARTICIPATE" measure
*with farris controls
logit cwinit c1_business_a c2_business_a business_business_a c1_s_far_maddisonGDP c2_s_far_maddisonGDP c1_s_far_Maddison_pop_estimate  c2_s_far_Maddison_pop_estimate  cap_1 cap_2 contig ldistance  cwpceyrs cwpceyrs2 cwpceyrs3 i.rlregion i.decade  , cluster(dyadid)
estimates store m1


*with farris controls + polyarchy and supsize
logit cwinit c1_business_a c2_business_a business_business_a v2x_polyarchy_min numgroups1 numgroups2 c1_v2regsupgroupssize c2_v2regsupgroupssize c1_s_far_maddisonGDP c2_s_far_maddisonGDP c1_s_far_Maddison_pop_estimate  c2_s_far_Maddison_pop_estimate  cap_1 cap_2 contig ldistance  cwpceyrs cwpceyrs2 cwpceyrs3 i.rlregion i.decade  , cluster(dyadid)
estimates store m2

*relogit
relogit cwinit c1_business_a c2_business_a business_business_a v2x_polyarchy_min numgroups1 numgroups2 c1_v2regsupgroupssize c2_v2regsupgroupssize c1_s_far_maddisonGDP c2_s_far_maddisonGDP c1_s_far_Maddison_pop_estimate  c2_s_far_Maddison_pop_estimate  cap_1 cap_2 contig ldistance  cwpceyrs cwpceyrs2 cwpceyrs3  , cluster(dyadid)
estimates store m3

*fixed effects
xtreg cwinit c1_business_a c2_business_a business_business_a v2x_polyarchy_min numgroups1 numgroups2 c1_v2regsupgroupssize c2_v2regsupgroupssize c1_s_far_maddisonGDP c2_s_far_maddisonGDP c1_s_far_Maddison_pop_estimate  c2_s_far_Maddison_pop_estimate  cap_1 cap_2 contig ldistance  cwpceyrs cwpceyrs2 cwpceyrs3 i.decade  , fe 
estimates store m4


****MODELS WITH THE relative measure

*with farris controls
logit cwinit c1_business_r c2_business_r business_business_r c1_s_far_maddisonGDP c2_s_far_maddisonGDP c1_s_far_Maddison_pop_estimate  c2_s_far_Maddison_pop_estimate  cap_1 cap_2 contig ldistance  cwpceyrs cwpceyrs2 cwpceyrs3 i.rlregion i.decade  , cluster(dyadid)
estimates store m5

*with farris controls + polyarchy and supsize
logit cwinit c1_business_r c2_business_r business_business_r v2x_polyarchy_min numgroups1 numgroups2 c1_v2regsupgroupssize c2_v2regsupgroupssize c1_s_far_maddisonGDP c2_s_far_maddisonGDP c1_s_far_Maddison_pop_estimate  c2_s_far_Maddison_pop_estimate  cap_1 cap_2 contig ldistance  cwpceyrs cwpceyrs2 cwpceyrs3 i.rlregion i.decade  , cluster(dyadid)
estimates store m6

*relogit
relogit cwinit c1_business_r c2_business_r business_business_r v2x_polyarchy_min numgroups1 numgroups2 c1_v2regsupgroupssize c2_v2regsupgroupssize c1_s_far_maddisonGDP c2_s_far_maddisonGDP c1_s_far_Maddison_pop_estimate  c2_s_far_Maddison_pop_estimate  cap_1 cap_2 contig ldistance  cwpceyrs cwpceyrs2 cwpceyrs3   , cluster(dyadid)
estimates store m7

*fixed effects
xtreg cwinit c1_business_r c2_business_r business_business_r v2x_polyarchy_min numgroups1 numgroups2 c1_v2regsupgroupssize c2_v2regsupgroupssize c1_s_far_maddisonGDP c2_s_far_maddisonGDP c1_s_far_Maddison_pop_estimate  c2_s_far_Maddison_pop_estimate  cap_1 cap_2 contig ldistance  cwpceyrs cwpceyrs2 cwpceyrs3 i.decade  , fe 
estimates store m8

esttab m1 m2 m3 m4 m5 m6 m7 m8 using "path\tablename.tex" ,   style(tex) nogaps compress mtitles label stats(N r2 regionFE decadeFE)



**********************************************************************************
***********       MARGINAL EFFECTS BASELINE MODELS                 ***************
**********************************************************************************

*Predictions
logit cwinit c1_business_a c2_business_a business_business_a  c1_s_far_maddisonGDP c2_s_far_maddisonGDP c1_s_far_Maddison_pop_estimate  c2_s_far_Maddison_pop_estimate  cap_1 cap_2 contig ldistance  cwpceyrs cwpceyrs2 cwpceyrs3 i.rlregion i.decade  , cluster(dyadid)
margins, at(c1_business_a=(0(1)1)) vce(unconditional)

marginsplot

quietly margins, at(business_business_a=(0(1)1)) vce(unconditional)
marginsplot
